<%-- 
    Document   : gererFilm.jsp
    Created on : Dec 9, 2012, 6:13:13 AM
    Author     : himanshu
--%>

<%@page import="java.util.ArrayList"%>
<%@page import="java.util.List"%>
<%@page import="com.myapp.struts.Film"%>
<%@page import="com.myapp.persistance.BaseDeDonnee"%>
<%@page import="java.sql.Connection"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@include file="commun.jsp" %>
<%= entete("BOUTIKONLINE")%>
<%@include file="Header_Admin.jsp" %>

 <div class="texte">
                       
                           <table border="1">
                               <tr bgcolor="#00BBBB">
                                   <td>Nom</td>
                                   <td>Acteur</td>
                                   <td>Realisateur</td>
                                   <td>Prix</td>
                                   <td>Date_de_sortie</td>
                                   <td>Date_de_disponibilite</td>
                                   <td bgcolor="#FFCC00">Supprimer</td>
                                   
                               </tr>
                               
                              
                               
                               <%   ;

                                    //instantiating database class
                                    BaseDeDonnee bd = new BaseDeDonnee();
                                    //connection to database
                                    Connection con =  bd.connecter();
                                    //get the film list
                                    List<Film> liste = new ArrayList<Film>();
                                    
                                    String alphabate ="f";
                                    
                                    if(request.getSession().getAttribute("alphabate")!=null){
                                        alphabate= request.getSession().getAttribute("alphabate").toString();
                                    }
                                    
                                    
                                    
                                    liste= bd.gererFilm(con, alphabate);
                                    
                                    
                                    if (liste !=null && !liste.isEmpty()){
                                    
                                        for(Film f : liste){
                                %>
                               
                                <tr>
                                    <td><%=f.getNom()%></td>
                                    <td><%=f.getActeur()%></td>
                                    <td><%=f.getRealisateur()%></td>
                                    <td><%=f.getPrix()%></td>
                                    <td><%=f.getDate_de_sortie()%></td>
                                    <td><%=f.getDate_de_disponibilite()%></td>
                                    <td>
                                        <html:form action="/supprimerfilm">
                                            
                                            <html:hidden name="Film" property="nom" value="<%=f.getNom()%>" />
                                            <html:submit value="supprimer" styleClass="text-button"/>
                                            
                                        </html:form>
                                    </td>
                                </tr>
                                
                                
                                
                               
                                <%  }
                                  } 
                                %>
                           </table>

                           
                           </br></br></br>
                           
                           <table> <tr>
                           <html:form action="/filmalphabate">
                               <html:hidden name="filmAlphabate" value="A" property="alphabate"/>
                               <html:submit value="A"/>
                           </html:form>
                           <html:form action="/filmalphabate">
                               <html:hidden name="filmAlphabate" value="B" property="alphabate"/>
                               <html:submit value="B"/>
                           </html:form>
                           <html:form action="/filmalphabate">
                               <html:hidden name="filmAlphabate" value="C" property="alphabate"/>
                               <html:submit value="C"/>
                           </html:form>
                           <html:form action="/filmalphabate">
                               <html:hidden name="filmAlphabate" value="D" property="alphabate"/>
                               <html:submit value="D"/>
                           </html:form>
                           <html:form action="/filmalphabate">
                               <html:hidden name="filmAlphabate" value="E" property="alphabate"/>
                               <html:submit value="E"/>
                           </html:form>
                           <html:form action="/filmalphabate">
                               <html:hidden name="filmAlphabate" value="F" property="alphabate"/>
                               <html:submit value="F"/>
                           </html:form>
                           <html:form action="/filmalphabate">
                               <html:hidden name="filmAlphabate" value="G" property="alphabate"/>
                               <html:submit value="G"/>
                           </html:form>
                           <html:form action="/filmalphabate">
                               <html:hidden name="filmAlphabate" value="H" property="alphabate"/>
                               <html:submit value="H"/>
                           </html:form>
                           <html:form action="/filmalphabate">
                               <html:hidden name="filmAlphabate" value="I" property="alphabate"/>
                               <html:submit value="I"/>
                           </html:form>
                           <html:form action="/filmalphabate">
                               <html:hidden name="filmAlphabate" value="J" property="alphabate"/>
                               <html:submit value="J"/>
                           </html:form>
                           <html:form action="/filmalphabate">
                               <html:hidden name="filmAlphabate" value="K" property="alphabate"/>
                               <html:submit value="K"/>
                           </html:form>
                           <html:form action="/filmalphabate">
                               <html:hidden name="filmAlphabate" value="L" property="alphabate"/>
                               <html:submit value="L"/>
                           </html:form>
                           <html:form action="/filmalphabate">
                               <html:hidden name="filmAlphabate" value="M" property="alphabate"/>
                               <html:submit value="M"/>
                           </html:form>
                           <html:form action="/filmalphabate">
                               <html:hidden name="filmAlphabate" value="N" property="alphabate"/>
                               <html:submit value="N"/>
                           </html:form>
                           <html:form action="/filmalphabate">
                               <html:hidden name="filmAlphabate" value="O" property="alphabate"/>
                               <html:submit value="O"/>
                           </html:form>
                           <html:form action="/filmalphabate">
                               <html:hidden name="filmAlphabate" value="P" property="alphabate"/>
                               <html:submit value="P"/>
                           </html:form>
                           <html:form action="/filmalphabate">
                               <html:hidden name="filmAlphabate" value="Q" property="alphabate"/>
                               <html:submit value="Q"/>
                           </html:form>
                           <html:form action="/filmalphabate">
                               <html:hidden name="filmAlphabate" value="R" property="alphabate"/>
                               <html:submit value="R"/>
                           </html:form>
                           <html:form action="/filmalphabate">
                               <html:hidden name="filmAlphabate" value="S" property="alphabate"/>
                               <html:submit value="S"/>
                           </html:form>
                           <html:form action="/filmalphabate">
                               <html:hidden name="filmAlphabate" value="T" property="alphabate"/>
                               <html:submit value="T"/>
                           </html:form>
                           <html:form action="/filmalphabate">
                               <html:hidden name="filmAlphabate" value="U" property="alphabate"/>
                               <html:submit value="U"/>
                           </html:form>
                           <html:form action="/filmalphabate">
                               <html:hidden name="filmAlphabate" value="V" property="alphabate"/>
                               <html:submit value="V"/>
                           </html:form>
                           <html:form action="/filmalphabate">
                               <html:hidden name="filmAlphabate" value="W" property="alphabate"/>
                               <html:submit value="W"/>
                           </html:form>
                           <html:form action="/filmalphabate">
                               <html:hidden name="filmAlphabate" value="X" property="alphabate"/>
                               <html:submit value="X"/>
                           </html:form>
                           <html:form action="/filmalphabate">
                               <html:hidden name="filmAlphabate" value="Y" property="alphabate"/>
                               <html:submit value="Y"/>
                           </html:form>
                           <html:form action="/filmalphabate">
                               <html:hidden name="filmAlphabate" value="Z" property="alphabate"/>
                               <html:submit value="Z"/>
                           </html:form>
                               </tr>
                           </table>
                          

</div>

<%@include file="Pied.jsp" %>%>

